package com.dingreading.cloud.common.util;

/**
 * 枚举类型
 */
public class EnumType {

    /**
     * 支付类型
     */
    public enum PayType {
        WECHAT(1, "微信", "WXPAY"),
        ALIPAY(2, "支付宝", "ALIPAY"),
        BANK(3, "银行转账", "BANK"),
        COUPON(4, "代金券", "COUPON"),
        SELF(5, "自营门店", "SELF"),
        GIFT(6, "商城赠品", "GIFT");

        //成员变量
        private final String name;
        private final String desc;
        private final int type;

        public int getType() {
            return type;
        }

        public String getDesc() {
            return desc;
        }

        public String getName() {
            return name;
        }

        //构造方法
        PayType(int type, String name, String desc) {
            this.type = type;
            this.name = name;
            this.desc = desc;
        }

        public static String getTypeName(int type) {
            for (PayType payType : PayType.values()) {
                if (payType.getType() == type) {
                    return payType.getName();
                }
            }
            return "";
        }
    }

    /**
     * 交易方式
     * 扫码支付：NATIVE、app支付：APP、公众号支付：JSAPI、H5支付：WAP
     */
    public enum TradeType {
        WECHAT_NATIVE("NATIVE", "微信扫码"),
        WECHAT_JSAPI("JSAPI", "微信公众号/小程序支付"),
        WECHAT_WAP("WAP", "微信H5"),
        ALIPAY_NATIVE("NATIVE", "支付宝扫码"),
        ALIPAY_WAP("WAP", "支付宝H5"),
        APP("APP", "app"),
        COUPON("COUPON", "代金券"),
        SELF("SELF", "自营门店"),
        BANK("BANK", "银行转账"),
        GIFT("GIFT", "商城赠品"),
        ;

        //成员变量
        private final String type;
        private final String name;

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        //构造方法
        TradeType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 支付通道
     * 支付宝扫码ALIPAY_QR;微信扫码WXPAY_QR
     */
    public enum PayChannelCode {
        WXPAY_QR("WXPAY_QR", "微信扫码"),
        WXPAY_H5("WXPAY_H5", "微信H5"),
        WXPAY_JSAPI("WXPAY_JSAPI", "微信公众号"),
        ALIPAY_H5("ALIPAY_H5", "支付宝H5"),
        ALIPAY_PC("ALIPAY_PC", "支付宝电脑"),
        ALIPAY_QR("ALIPAY_QR", "支付宝扫码"),
        COUPON("COUPON", "代金券"),
        SELF("SELF", "自营门店"),
        BANK("BANK", "银行转账"),
        GIFT("GIFT", "商城赠品"),
        ;


        //成员变量
        private final String type;
        private final String name;

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        //构造方法
        PayChannelCode(String type, String name) {
            this.type = type;
            this.name = name;
        }

        public static String getTypeName(String type) {
            for (PayChannelCode channelCode : PayChannelCode.values()) {
                if (channelCode.getType().equals(type)) {
                    return channelCode.getName();
                }
            }
            return "";
        }
    }

    /**
     * 会员签到类型
     */
    public enum SignInType {
        SIGN_IN(1, "签到"),
        SIGN_OUT(2, "签退");

        //成员变量
        private final int type;
        private final String name;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        //构造方法
        SignInType(int type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 会员行为类型
     */
    public enum ActionType {
        READ_BOOK(1, "读书记录");

        //成员变量
        private final int type;
        private final String name;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        //构造方法
        ActionType(int type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 操作人类型
     */
    public enum OPERATOR {
        SYS(0, "系统"),
        HEAD(1, "总部员工"),
        STAFF(2, "门店员工");

        //成员变量
        private final int type;
        private final String name;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        OPERATOR(int type, String name) {
            this.type = type;
            this.name = name;
        }

        public static String getStatus(int status) {
            for (BalanceProject contactType : BalanceProject.values()) {
                if (contactType.getType() == status) {
                    return contactType.getName();
                }
            }
            return "";
        }
    }

    /**
     * 收支项目
     */
    public enum BalanceProject {
        BUY_GOODS(1, "商城商品"),
        CORP_PAY(2, "叮叮合作费"),
        PURCHASE(3, "采购订单"),
        GIFT_GOODS(4, "商城赠品"),
        SUMMER_STUDENT(5, "暑期老生专场"),
        ;

        //成员变量
        private final int type;
        private final String name;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        BalanceProject(int type, String name) {
            this.type = type;
            this.name = name;
        }

        public static String getStatus(int status) {
            for (BalanceProject contactType : BalanceProject.values()) {
                if (contactType.getType() == status) {
                    return contactType.getName();
                }
            }
            return "";
        }
    }

    /**
     * 收支类型
     */
    public enum Payment {
        IN("收入", 1),
        OUT("支出", 2);

        //成员变量
        private final String name;
        private final int type;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        //构造方法
        Payment(String name, int type) {
            this.name = name;
            this.type = type;
        }
    }

    /**
     * 购物车类型
     */
    public enum ShopCartType {
        ADD(1, "加入购物车"),
        NOW_BUY(2, "立即购买"),
        GIFT(3, "赠品购物车");

        //成员变量
        private final int type;
        private final String name;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        ShopCartType(int type, String name) {
            this.type = type;
            this.name = name;
        }

        public static String getStatus(int type) {
            for (ShopCartType cartType : ShopCartType.values()) {
                if (cartType.getType() == type) {
                    return cartType.getName();
                }
            }
            return "";
        }
    }

    /**
     * 购物车状态
     */
    public enum ShopCart {
        REFUND(-1, "已退费", ""),
        CANCEL(0, "取消", ""),
        PAYED(1, "已付款", "已付款"),
        WAIT_CONFIRM(2, "待确认", "用户已下单，待总部确认中"),
        WAIT_PAY(3, "待付款", "总部确认后，用户可付款"),
        SEND(4, "已出库", "已付款，总部商品出库完成"),
        ;

        //成员变量
        private final int type;
        private final String name;
        private final String desc;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        public String getDesc() {
            return desc;
        }

        ShopCart(int type, String name, String desc) {
            this.type = type;
            this.name = name;
            this.desc = desc;
        }

        public static String getStatus(int type) {
            for (BalanceProject project : BalanceProject.values()) {
                if (project.getType() == type) {
                    return project.getName();
                }
            }
            return "";
        }
    }

    /**
     * 订单状态
     */
    public enum OrderForm {
        REFUND(-1, "已退费", ""),
        CANCEL(0, "已取消", ""),
        OK(1, "已完成", "总部已发货"),
        WAIT_CONFIRM(2, "待确认", "用户已下单，总部确认中"),
        RESUME(21, "已恢复", ""),
        WAIT_PAY(3, "待付款", "总部确认后，用户可付款"),
        APPLY_BANKPAY(31, "银行转账审核中", "客户上传银行转账截图，待审核"),
        CANCEL_BANKPAY(32, "取消银行转账", "客户取消银行转账"),
        REFUSE_BANKPAY(33, "银行转账被驳回", "财务驳回银行转账"),
        REVOCATION_BANKPAY(34, "撤回审核通过的银行转账", "撤回已审核通过的银行转账"),
        WAIT_SEND(4, "待发货", "用户已付款，总部待发货"),
        SENDING(41, "发货中", "用户已付款，总部发货中"),
        REVOCATION_GIFT(51, "撤回通过的赠品订单", "运营撤回通过的赠品订单"),
        MDY_SALE_STAFF(60, "修改签单人信息", ""),
        FINANCE_CHECK_WAIT(90, "财务待审核", "线下支付需财务审核"),
        FINANCE_CHECK_OK(91, "财务审核通过", ""),
        FINANCE_CHECK_REFUSE(92, "财务审核拒绝", ""),
        FINANCE_SUBMIT(93, "银行转账截图重新提交财务", ""),
        SYSTEM_CHECK_OK(99, "系统审核通过", "线上支付默认通过"),
        ;

        //成员变量
        private final int type;
        private final String name;
        private final String desc;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        public String getDesc() {
            return desc;
        }

        //构造方法
        OrderForm(int type, String name, String desc) {
            this.type = type;
            this.name = name;
            this.desc = desc;
        }

        public static String getStatus(int type) {
            for (OrderForm form : OrderForm.values()) {
                if (form.getType() == type) {
                    return form.getName();
                }
            }
            return "";
        }
    }

    /**
     * 加盟商合作类型
     */
    public enum Cooperation {
        DIRECT(1, "直营"),
        COLLOCATION(2, "托管运营"),
        JOIN(3, "整店加盟"),
        PROGRAM(4, "方案输出");

        //成员变量
        private final int type;
        private final String name;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        Cooperation(int type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 微信/支付包的订单流水号类型
     */
    public enum CodeType {
        CGSP("CGSP", "采购商品"),
        HYDD("HYDD", "会员订单"),
        HZDD("HZDD", "叮叮合作费"),
        SQZC("SLZC", "暑期老生专场"),
        RD("RD", "好读之星");

        //成员变量
        private final String type;
        private final String name;

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        CodeType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 订单分类 toB、toC、收支流水号
     */
    public enum CodeCategory {
        TOB("BM", "toB"),
        TOC("CM", "toC"),
        PAY("PAY", "收支流水"),
        CGDD("CGDD", "采购订单"),
        RK("RK", "入库订单"),
        CK("CK", "出库订单"),
        HTBH("HT", "合同编号"),
        CM("CM", "会员服务订单编号"),
        AC("AC", "会员服务订单申请变更或退费的编号"),
        NJ("NJ", "南京大会门票"),
        RD("RD", "好读之星");

        //成员变量
        private final String type;
        private final String name;

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        CodeCategory(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 采购订单状态
     */
    public enum Purchase {
        FAIL(-1, "审核失败", ""),
        CANCEL(0, "已取消", ""),
        OK(1, "已完成", "商品全部入库"),
        SAVE(2, "保存", "未提交采购订单"),
        STEP_1(3, "待入库", "提交采购订单"),
        STEP_2(4, "入库中", "商品部分入库");

        //成员变量
        private final int type;
        private final String name;
        private final String desc;

        public int getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        public String getDesc() {
            return desc;
        }

        //构造方法
        Purchase(int type, String name, String desc) {
            this.type = type;
            this.name = name;
            this.desc = desc;
        }

        public static String getStatus(int type) {
            for (Purchase data : Purchase.values()) {
                if (data.getType() == type) {
                    return data.getName();
                }
            }
            return "";
        }
    }

    /**
     * 跟进类型
     */
    public enum Follow {
        SAVE("d295721b772d4c65b2d9c1dc8f8cfd95", "创建会员", ""),
        EXCEL("0708eb41aad24516b1b09b9e4d1149bc", "导入会员", ""),
        UPDATE("53d61b96700f4a848c38791a7e927ab2", "更新会员信息", ""),
        ALLOT_STAFF("927c29898bd94002af7967f0ce821f56", "分配跟进人", ""),
        GIVE_UP("fe289299e16f4f269a81487e22e4cd26", "放弃跟进", ""),
        NEW_ORDER("fab653a593d54099b711d44e20f2208d", "创建服务订单", ""),
        UPDATE_ORDER("85fb355b047d489cb27e7d7fa7c49c9e", "更新服务订单", ""),
        OPEN_CARD("b59a66ffb1ae49c3b148ac95fbe3859b", "开卡", ""),
        PAUSE_CARD("d5109f9b7697454faccd0665abd9bfa7", "暂停服务", ""),
        CONTINUE_CARD("d21822ec72e5474586d6dc6d32ec3d7e", "继续服务", ""),
        AUDITION("3d6c7f0f14114b00ab26dca05a3ce027", "试听服务", ""),
        OTHER("338a96e16cd246eda8e3cf349663bbc0", "其他", ""),
        NEW_CHANGE_ORDER("42ad7a1e7cbb470987120fc7a5511bc1", "申请变更订单", ""),
        NEW_REFUND_ORDER("021b2b56c9854be89441dbfb076d88f5", "申请退费订单", ""),
        MEMBER_VALID("90a562ad1e7a408087cdaf42ca20fa88", "会员有效状态", ""),
        EDIT_LESSON_NUM("75eb95d4440511efa76b00163e2576bb", "修改活动次数", ""),
        AUDIT_ORDER("75eb95d4440511efa76b00163e2576cc", "审批会员订单", ""),
        ;

        //成员变量
        private final String type;
        private final String name;
        private final String desc;

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        public String getDesc() {
            return desc;
        }

        //构造方法
        Follow(String type, String name, String desc) {
            this.type = type;
            this.name = name;
            this.desc = desc;
        }

        public static String getStatus(String type) {
            for (Follow data : Follow.values()) {
                if (data.getType().equals(type)) {
                    return data.getName();
                }
            }
            return "";
        }
    }

    /**
     * 产品编号
     * 体验会员:1，好读团:2，精读会:3，文学社:4，悦读坊:5，绘本营:6
     */
    public enum ProductCode {
        TIYAN("1", "体验会员", 0),
        HAODU("2", "好读团", 0),
        JINGDU("3", "精读会", 1),
        WENXUE("4", "文学社", 1),
        YUEDU("5", "悦读坊", 0),
        HUIBEN("6", "绘本营", 0),
        SIDA("7", "四大名著", 1),
        YANXUE("8", "研学", 0),
        ;

        //成员变量
        private final String type;
        private final String name;
        private final int arrange;

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        public int getArrange() {
            return arrange;
        }

        //构造方法
        ProductCode(String type, String name, int arrange) {
            this.type = type;
            this.name = name;
            this.arrange = arrange;
        }

        public static String getName(String type) {
            for (ProductCode data : ProductCode.values()) {
                if (data.getType().equals(type)) {
                    return data.getName();
                }
            }
            return "";
        }
    }

    /**
     * 收入类型
     * 体验会员:EXP，正式会员新签:NEW，续费:RENEW，拓科:EXT，订金:EMD
     */
    public enum OrderType {
        EXP("EXP", "体验会员"),
        NEW("NEW", "正式会员新签"),
        RENEW("RENEW", "续费"),
        EXT("EXT", "拓科"),
        EMD("EMD", "订金"),
        GIFT("GIFT", "赠送"),
        REFUND("REFUND", "退费"),
        ;

        //成员变量
        private final String type;
        private final String name;

        public String getType() {
            return type;
        }

        public String getName() {
            return name;
        }

        //构造方法
        OrderType(String type, String name) {
            this.type = type;
            this.name = name;
        }

        public static String getName(String type) {
            for (OrderType data : OrderType.values()) {
                if (data.getType().equals(type)) {
                    return data.getName();
                }
            }
            return "";
        }
    }


    /**
     * 门店员工角色
     */
    public enum StaffRoleType {
        DIANZHANG("店长", ",20,21,30,50,", ",mall,lesson,som,pb,books,", 1),
        GUWEN("店助", ",21,", ",som,pb,books,", 2),
        ZUZHANG("导读组长", ",20,30,", ",lesson,som,pb,books,", 3),
        DAODU("导读", ",20,", ",lesson,som,pb,books,", 4),
        MARKET_TOP("市场组长", ",22,32,", ",som,pb,books,douxuehui,", 5),
        MARKET("市场员工", ",22,", ",som,douxuehui,", 6);

        private final String name;
        private final String roles;
        private final String auth;
        private final Integer roleNum;

        public String getName() {
            return name;
        }

        public String getRoles() {
            return roles;
        }

        public String getAuth() {
            return auth;
        }

        public Integer getRoleNum() {
            return roleNum;
        }

        // 构造方法
        StaffRoleType(String name, String roles, String auth, Integer roleNum) {
            this.name = name;
            this.roles = roles;
            this.auth = auth;
            this.roleNum = roleNum;
        }

        public static StaffRoleType getType(int role) {
            for (StaffRoleType data : StaffRoleType.values()) {
                if (data.getRoleNum().equals(role)) {
                    return data;
                }
            }
            return null;
        }
    }


    /**
     * 会员订单的订单状态
     */
    public enum CmOrderState {
        OK(1, "正常"),
        CHANGE(2, "变更"),
        REFUND(3, "退费"),
        AL_CHANGE(4, "已变更"),
        AL_REFUND(5, "已退费"),
        AL_CHANGE_REFUND(5, "已变更和退费"),
        ;

        //成员变量
        private final int state;
        private final String name;

        public int getState() {
            return state;
        }

        public String getName() {
            return name;
        }

        //构造方法
        CmOrderState(int state, String name) {
            this.state = state;
            this.name = name;
        }

        public static String getStatus(int state) {
            for (CmOrderState data : CmOrderState.values()) {
                if (data.getState() == state) {
                    return data.getName();
                }
            }
            return "";
        }
    }

    /**
     * 服务状态
     */
    public enum ServiceStatus {
        OPEN_CARD(1, "已开卡", ""),
        PAUSE_CARD(0, "暂停服务", ""),
        NO_CARD(-1, "未开卡", ""),
        NO_CHANGE(0, "未变更", ""),
        CONSUME(-6, "已消耗", ""),
        CHANGE(-7, "已变更", ""),
        REFUND(-8, "已退费", ""),
        INVALID(-9, "已作废", ""),
        ;

        //成员变量
        private final int status;
        private final String name;
        private final String desc;

        public int getStatus() {
            return status;
        }

        public String getName() {
            return name;
        }

        public String getDesc() {
            return desc;
        }

        //构造方法
        ServiceStatus(int status, String name, String desc) {
            this.status = status;
            this.name = name;
            this.desc = desc;
        }

        public static String getStatus(int status) {
            for (ServiceStatus data : ServiceStatus.values()) {
                if (data.getStatus() == status) {
                    return data.getName();
                }
            }
            return "";
        }
    }

    /**
     * 数据来源
     */
    public enum Source {
        STORE("store", "门店录入"),
        MARKET("market", "市场录入"),
        XCX("xcx", "小程序录入"),
        XCX_MDB("xcx_mdb", "叮叮好读书"),
        ;

        //成员变量
        private final String name;
        private final String desc;

        public String getName() {
            return name;
        }

        public String getDesc() {
            return desc;
        }

        //构造方法
        Source(String name, String desc) {
            this.name = name;
            this.desc = desc;
        }

    }

}
